GBFilePicker
GBFilePicker
()
Not part of the module api.
Removes empty elements from an array. (can be useful when using function explode to create the array from a csv)
array
CleanArray
(array $array)
-
array
$array: - the array to clean up
Not part of the module api.
Replaces all multiple DIRECTORY_SEPARATOR, dots and (multiple) slashes with one single DIRECTORY_SEPARATOR to make a clean save url parameter
string
CleanPath
(string $path, [string $fullPath = true])
-
string
$path: - the path to clean
-
string
$fullPath: - true to prepend uploads path on return, false to return only the cleaned $path
Not part of the module api.
Replaces all multiple slashes, dots and (multiple) backslashes with one single slash to make a clean save url parameter
string
CleanURL
(string $url, [string $fullUrl = true])
-
string
$url: - the url to clean
-
string
$fullUrl: - true to prepend uploads url on return, false to return only the cleaned $url
Not part of the module api.
Taken from TinyMCE Module.
void
ContainsIllegalChars
( $filename)
Not part of the module api.
Create a dropdown form element containing a list of files that match certain conditions
string
CreateFileDropdown
(string $id, string $name, [string $dir = ''], [string $selected = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [array|string $fileExt = ''], [string $type = ''], [boolean $allowNone = true])
-
string
$id: - the module id
-
string
$name: - the name of the input field
-
string
$dir: - the directory to list the files of (may be relative to uploads dir or absolute path)
-
string
$selected: - the preselected value
-
array|string
$excludePrefix: - fileprefixes to exclude (array('foo','bar',...) or csv)
-
array|string
$includePrefix: - fileprefixes to include (array('foo','bar',...) or csv)
-
array|string
$excludeSufix: - filesufixes to exclude (array('foo','bar',...) or csv)
-
array|string
$includeSufix: - filesufixes to include (array('foo','bar',...) or csv)
-
array|string
$fileExt: - filesufixes to include (array('foo','bar',...) or csv)
-
string
$type: - file or image
-
boolean
$allowNone: - set to false to hide the option 'none'
Not part of the module api.
Creates the filepicker input.
string
CreateFilePickerInput
(string $id, string $name, [string $value = ''], [string $dir = ''], [ $size = ''], [string $addTxt = ''], [string $type = 'image'], [string $mode = 'dropdown'], [string $showSubDirs = false], [string $upload = false], [string $delete = false], [string $createDirs = false], [string $lockInput = true], [array|string $fileExt = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [boolean $allowNone = true])
-
string
$id: - the module id
-
string
$name: - the name of the input field
-
string
$value: - the preselected value
-
string
$dir: - the directory to list the files of (may be relative to uploads dir or absolute path)
-
string
$addTxt: - any additional text that will be added to the html text input when tag is rendered (only works with mode='browser' at the moment)
-
string
$type: - 'image' or 'file'
-
string
$mode: - 'dropdown' or 'browser'
-
string
$showSubDirs: - set to true to show subdirs
-
string
$upload: - set to true to allow file upload
-
string
$delete: - set to true to allow to delete of files and empty subdirs
-
string
$createDirs: - set to true to allow to create subdirs
-
string
$lockInput: - set to false to allow to enter the path to the file
-
array|string
$fileExt: - allowed file extensions (array or csv)
-
array|string
$excludePrefix: - fileprefixes to exclude (array('foo','bar',...) or csv)
-
array|string
$includePrefix: - fileprefixes to include (array('foo','bar',...) or csv)
-
array|string
$excludeSufix: - filesufixes to exclude (array('foo','bar',...) or csv)
-
array|string
$includeSufix: - filesufixes to include (array('foo','bar',...) or csv)
-
boolean
$allowNone: - set to false to hide the option 'none'
-
$size
void
DoAction
( $action, $id, $params, [ $returnid = ''])
-
$action
-
$id
-
$params
-
$returnid
void
DoEvent
( $originator, $eventname, &$params)
-
$originator
-
$eventname
-
&$params
Not part of the module api.
Gets the icon for the file operation. If FileManager is installed it uses FileManager icons. Otherwise it uses own icons
string
GetActionIcon
(string $action)
-
string
$action: - the file operation (e.g. 'delete')
void
GetAdminDescription
()
void
GetContentBlockInput
( $blockName, $value, $params, [ $adding = false])
-
$blockName
-
$value
-
$params
-
$adding
Not part of the module api.
Gets the icon for a file. If FileManager is installed it uses FileManager icons. Otherwise it uses own icons.
string
GetFileIcon
(array $fileInfo)
-
array
$fileInfo: - an array with info about the file ('ext'=>file extension, 'isdir'=>true/false, isimage=>true/false)
Not part of the module api.
Return an array containing a list of files in a directory. Performs a non recursive search.
array
GetFiles
([string $dir = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [array|string $fileExt = ''], [string $type = 'image'], [boolean $excludeDirs = false])
-
string
$dir: - the directory to list the files of (may be relative to uploads dir or absolute path)
-
array|string
$excludePrefix: - fileprefixes to exclude (array('foo','bar',...) or csv)
-
array|string
$includePrefix: - fileprefixes to include (array('foo','bar',...) or csv)
-
array|string
$excludeSufix: - filesufixes to exclude (array('foo','bar',...) or csv)
-
array|string
$includeSufix: - filesufixes to include (array('foo','bar',...) or csv)
-
array|string
$fileExt: - filesufixes to include (array('foo','bar',...) or csv)
-
string
$type: - file or image
-
boolean
$excludeDirs: - set to true to exclude directories
Not part of the module api.
Gets the file type of a file.
string
GetFileType
(string $file, [string $useMime = false])
-
string
$file: - the path to a file
-
string
$useMime: - set to true to detect file type by mime type
Not part of the module api.
Returns the thumbnail of a given image file.
string
GetThumbnail
(string $path, [string $makeThumbnail = true], [string $urlOnly = false])
-
string
$path: - the path of the file to create a thumbnail of (can be relative to the uploads dir or absolute)
-
string
$makeThumbnail: - set to false if thumbnail may not be created if not exists
-
string
$urlOnly: - set to true to get only the url to the thumbnail
Not part of the module api.
Adapted from TinyMCE filepicker.
void
HandleFileResizing
( $source, $output, $newWidth, $newHeight, [ $keepAspectRatio = true], [ $allowUpscaling = false], [ $quality = 100])
-
$source
-
$output
-
$newWidth
-
$newHeight
-
$keepAspectRatio
-
$allowUpscaling
-
$quality
void
HasCapability
( $capability, [ $params = array()])
void
InstallPostMessage
()
Not part of the module api.
Taken from TinyMCE Module (extracted from filepicker).
void
IsDirEmpty
( $dir)
Not part of the module api.
Checks if a value is really meant to be "false". Can be usefull when checking smarty params for the value false
bool
IsFalse
(mixed $value)
-
mixed
$value: - the value to check
Not part of the module api.
Checks if a value is really meant to be "true". Can be usefull when checking smarty params for the value true
bool
IsTrue
(mixed $value)
-
mixed
$value: - the value to check
Not part of the module api.
Checks if a var is empty. If $var is an array it recursivley checks all elements.
boolean
IsVarEmpty
( &$var, [boolean $trim = true], [boolean $unsetEmptyIndexes = false], mixed $var)
-
mixed
$var: - the var to check for empty value(s)
-
boolean
$trim: - true to trim off spaces
-
boolean
$unsetEmptyIndexes: - true to delete empty elements from array
-
&$var
void
MaximumCMSVersion
()
void
MinimumCMSVersion
()
Not part of the module api.
Taken from TinyMCE filepicker.
void
SortFiles
( $file1, $file2)
void
UninstallPostMessage
()
void
UninstallPreMessage
()
void
VisibleToAdminUser
()